package com.gomoku.backend.controller.user;

import com.alibaba.fastjson2.JSONObject;
import com.gomoku.backend.service.user.UserContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class UserContentController {

    @Autowired
    private UserContentService userContentService;

    @RequestMapping("/user/getuserrecords/")
    public JSONObject getUserRecords(@RequestParam Map<String,String> data){
        Integer userId = Integer.valueOf(data.get("userId"));
        Integer page = Integer.valueOf(data.get("page"));
        return userContentService.getUserRecords(userId,page);
    }
}
